#include "processWidget.h"
#include <qpainter.h>
#include <qpen.h>
#include <qbrush.h>
ProcessWidget::ProcessWidget(int id, QWidget* parent):
	QWidget(parent),m_id(id),m_posX(0)
{
	setFixedSize(50, 50);
}
int ProcessWidget::posX() const {
    return m_posX;
}

void ProcessWidget::setPosX(int x) {
    m_posX = x;
    move(m_posX, y());
    update();
}

void ProcessWidget::paintEvent(QPaintEvent* event) {
    QPainter painter(this);
    painter.setPen(QPen(Qt::black, 2));
    painter.setBrush(QBrush(Qt::green));
    painter.drawRect(rect());
    painter.drawText(rect(), Qt::AlignCenter, QString::number(m_id));
}